{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf440
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 LucidaGrande;
\f3\fnil\fcharset77 Monaco;}
{\colortbl;\red255\green255\blue255;\red34\green34\blue34;\red118\green15\blue80;\red170\green13\blue145;
\red92\green38\blue153;\red100\green56\blue32;\red196\green26\blue22;\red0\green116\blue0;\red46\green13\blue110;
\red28\green0\blue207;\red38\green71\blue75;\red35\green110\blue37;\red137\green19\blue21;\red0\green0\blue255;
}
\margl1440\margr1440\vieww15960\viewh15680\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\b\fs48 \cf0 CocoaSmugMug 1.2\

\f1\b0\fs24 An Objective-C wrapper for the SmugMug 1.2 photo service APIs.\
\

\f0\b Date
\f1\b0 \
2/1/2008\
\

\f0\b Release
\f1\b0 \
 v1.2 (initial release)\
\

\f0\b Author
\f1\b0 \
Chris Beauvois\
\pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural
\cf0 (cocoasmugmug at mechanicalmoon dot com)\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\b \cf0 License
\f1\b0  \
MIT license:\
http://www.opensource.org/licenses/mit-license.php\
\

\f0\b Development Requirements\
\pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural

\f2\b0\fs22 \cf2 \'a5 
\f1\fs24 \cf0 OS X 10.4.x/10.5.x
\f0\b \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f2\b0\fs22 \cf2 \'a5 
\f1\fs24 \cf0 Cocoa.framework\
\pard\tx0\tx1120\tx2240\tx3360\tx4480\tx5600\tx6720\tx7840\tx8960\tx10080\tx11200\tx12320\tx13440\tx14560\tx15680\tx16800\tx17920\tx19040\tx20160\tx21280\tx22400\tx23520\tx24640\tx25760\tx26880\tx28000\tx29120\tx30240\tx31360\tx32480\tx33600\tx34720\ql\qnatural

\f2\fs22 \cf2 \'a5 
\f1\fs24 \cf0 /usr/lib/libcrypto.0.9.x.dylib (ships with OS X 10.4/5, Include in project frameworks) \
\
\
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\b\fs36 \cf0 Getting Started\

\f1\b0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\fs24 \cf0 SmugMug provides four choices of response formats: REST, JSON, PHP, and XML-RPC (default is REST). CocoaSmugMug defers parsing responses to a simple protocol (ResponseFormatter, see CocoaSmugMug.h) that you implement using the toolkit of your choosing for your choice of response format.\
\
For example, to parse JSON-formatted responses using Blake Seely's BSJSONAdditions (available at http://blakeseely.com/downloads.html):\
\
\
First, implement the ResponseFormatter protocol, or create a new class that implements the protocol:\
\
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf3 \CocoaLigature0 @interface\cf0  BSJSONResponseFormatter : NSObject <ResponseFormatter>\
\cf3 @end\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
ResponseFormatter has two methods:\
\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f3\fs20 \cf4 \CocoaLigature0 @protocol\cf0  ResponseFormatter <\cf5 NSObject\cf0 >\
- (\cf5 NSString\cf0  *)formatType;\
- (\cf5 NSDictionary\cf0  *)formatDictionaryFromResponseData:(\cf5 NSData\cf0  *)data;\
\cf4 @end\cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
The 
\f3\fs20 \CocoaLigature0 formatType
\f1\fs24 \CocoaLigature1  method returns the JSON format type, declared in CocoaSmugMug.h:\
\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 - (\cf5 NSString\cf0  *)formatType\
\{\
	\cf4 return\cf0  \cf6 SMUGMUG_JSON_FORMAT\cf0 ;\
\}\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 The 
\f3\fs20 \CocoaLigature0 formatDictionaryFromResponseData:
\f1\fs24 \CocoaLigature1  method converts the JSON-formatted response data into an NSDictionary. \
BSJSONAdditions adds a category to NSDictionary for converting a JSON-formatted string into an NSDictionary:\
\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f3\fs20 \cf6 \CocoaLigature0 #import \cf7 "NSDictionary+BSJSONAdditions.h"\cf6 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 - (\cf5 NSDictionary\cf0  *)formatDictionaryFromResponseData:(\cf5 NSData\cf0  *)data\
\{\
	\cf8 // create an autoreleased NSString from data\cf0 \
	\cf5 NSMutableString\cf0  *jsonString = [[[\cf5 NSMutableString\cf0  \cf9 alloc\cf0 ] \cf9 initWithData\cf0 :data \cf9 encoding\cf0 :\cf9 NSUTF8StringEncoding\cf0 ] autorelease];\
\
	\cf8 // fix JSON URLs\cf0 \
	[jsonString \cf9 replaceOccurrencesOfString\cf0 :\cf7 @"\\\\/"\cf0  \cf9 withString\cf0 :\cf7 @"/"\cf0  \cf9 options\cf0 :\cf9 NSCaseInsensitiveSearch\cf0  \cf9 range\cf0 :\cf9 NSMakeRange\cf0 (\cf10 0\cf0 , [string \cf9 length\cf0 ])];\
\
	\cf8 // now, format the response\cf0 \
	\cf5 NSDictionary\cf0  *responseDictionary = [\cf5 NSDictionary\cf0  \cf11 dictionaryWithJSONString\cf0 :jsonString];\
	\
	\cf4 return\cf0  responseDictionary;\
\}\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\b\fs36 \cf0 Usage
\f1\b0 \
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\fs24 \cf0 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 When instanciating CocoaSmugMug, the designated initializer's single argument is an instance of your formatter:\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural
\cf0 \
	
\f3\fs20 \CocoaLigature0 BSJSONResponseFormatter *formatter = [[[BSJSONResponseFormatter alloc] init] autorelease];
\f1\fs24 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	CocoaSmugMug *smugmug = [[CocoaSmugMug alloc] initWithResponseFormatter:formatter];\
\pard\tx480\pardeftab480\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 You are now ready to begin using CocoaSmugMug:\
\
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	\cf12 // login\
\cf0 	SmugMugResponse *response = [smugmug secureLoginWithAPIKey:apiKey email:userEmail password:userPassword];\
\
	\cf12 // login with password hash\cf0 \
	NSString *hash = [[[response responseDictionary] objectForKey:\cf13 @"Login"\cf0 ] objectForKey:\cf13 @"PasswordHash"\cf0 ];\
	NSString *userID = [[[[response responseDictionary] objectForKey:\cf13 @"Login"\cf0 ] objectForKey:\cf13 @"User"\cf0 ] objectForKey:\cf13 @"id"\cf0 ];	\
	response = [smugmug loginWithAPIKey:apiKey userID:userID passwordHash:hash];\
\
	\cf12 // to use SSL for all requests (add libcrypto.0.9.7.dylib to your project's frameworks) \
\cf0 	[smugmug setShouldUseSSL:\cf3 YES\cf0 ];\
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	\cf12 // to get your account tree, albums or categories\
\cf0 	response = [smugmug getTree];\
	NSLog(\cf13 @"\\n\\ngetTree:\\n%@\\n\\n-------------------------------------"\cf0 , [response responseDictionary]);\
	response = [smugmug getAllAlbums];\
	NSLog(\cf13 @"\\n\\ngetAllAlbums:\\n%@\\n\\n-------------------------------------"\cf0 , [response responseDictionary]);\
	response = [smugmug getAllSubCategories];\
	NSLog(\cf13 @"\\n\\ngetAllSubCategories:\\n%@\\n\\n-------------------------------------"\cf0 , [response responseDictionary]);\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	\cf12 // to create a category
\f1\fs24 \cf0 \CocoaLigature1 \

\f3\fs20 \CocoaLigature0 	response = [smugmug createCategory:\cf13 @"Test Category"\cf0 ];\
	NSNumber *testCategoryID = [[[response responseDictionary] objectForKey:\cf13 @"Category"\cf0 ] objectForKey:\cf13 @"id"\cf0 ];\
\
	\cf12 // to create a subcategory\cf0 \
	response = [smugmug createSubCategoryWithName:\cf13 @"Test Subcategory"\cf0  forCategory:testCategoryID];\
	NSNumber *testSubcategoryID = [[[response responseDictionary] objectForKey:\cf13 @"SubCategory"\cf0 ] objectForKey:\cf13 @"id"\cf0 ];\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	\cf12 // to create and customize an album in one shot\cf0 \
	response = [smugmug createAlbumWithTitle:\cf13 @"Test Album"\cf0 \
						categoryID:testCategoryID\
						albumTemplateID:[NSNumber numberWithInt:\cf14 0\cf0 ]\
						subCategoryID:testSubcategoryID\
						communityID:[NSNumber numberWithInt:\cf14 0\cf0 ]\
						description:\cf13 @"This is a test"\cf0 \
						keywords:\cf3 nil\cf0 \
						password:\cf3 nil\cf0 \
						passwordHint:\cf3 nil\cf0 \
						position:[NSNumber numberWithInt:\cf14 3\cf0 ]\
						sortMethod:\cf3 nil\cf0 \
						sortDirection:\cf3 YES\cf0 \
						public:\cf3 NO\cf0 \
						filenames:\cf3 NO\cf0 \
						comments:\cf3 NO\cf0 \
						external:\cf3 NO\cf0 \
						EXIF:\cf3 YES\cf0 \
						share:\cf3 NO\cf0 \
						printable:\cf3 YES\cf0 \
						originals:\cf3 YES\cf0 \
						familyEdit:\cf3 NO\cf0 \
						friendEdit:\cf3 NO\cf0 \
						header:\cf3 NO\cf0 \
						templateID:[NSNumber numberWithInt:\cf14 0\cf0 ]\
						larges:\cf3 YES\cf0 \
						clean:\cf3 YES\cf0 \
						protected:\cf3 YES\cf0 \
						watermarking:\cf3 NO\cf0 \
						proofDays:[NSNumber numberWithInt:\cf14 5\cf0 ]\
						backprinting:\cf3 nil\cf0 \
						smugSearchable:\cf3 nil\cf0 \
						worldSearchable:\cf3 nil\cf0 ];\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	NSNumber *testAlbumID = [[[response responseDictionary] objectForKey:\cf13 @"Album"\cf0 ] objectForKey:\cf13 @"id"\cf0 ];\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	\cf12 // synchronous upload
\f1\fs24 \cf0 \CocoaLigature1 \

\f3\fs20 \CocoaLigature0 	response = [smugmug imageUpload:[NSURL URLWithString:\cf13 @"http://mechanicalmoon.com/Chris.jpg"\cf0 ] \
							toAlbum:testAlbumID \
						   withName:\cf3 nil\cf0  \
							caption:\cf13 @"synchronous"\cf0  \
						   keywords:[NSArray arrayWithObject:\cf13 @"testing; one; two"\cf0 ] \
						   latitude:[NSNumber numberWithDouble:\cf14 40.714\cf0 ] \
						  longitude:[NSNumber numberWithDouble:\cf14 -74.006\cf0 ] \
						   altitude:[NSNumber numberWithInt:\cf14 33\cf0 ]];\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 	\cf12 // asynchronous upload\
\cf0 	[[NSDistributedNotificationCenter defaultCenter] addObserver:\cf3 self\cf0  \
														selector:\cf3 @selector\cf0 (didCompleteUploadNotification:) \
															name:CocoaSmugMugDidCompleteUploadNotification \
														  object:\cf3 nil\cf0 ];\
\
	[[NSDistributedNotificationCenter defaultCenter] addObserver:\cf3 self\cf0  \
														selector:\cf3 @selector\cf0 (errorDuringUploadNotification:) \
															name:CocoaSmugMugUploadErrorNotification \
														  object:\cf3 nil\cf0 ];\
\
	NSString *transactionID = [smugmug threadedImageUpload:[NSURL URLWithString:\cf13 @"http://mechanicalmoon.com/Chris.jpg"\cf0 ] \
												   toAlbum:testAlbumID \
												  withName:\cf13 @"Chris.jpg"\cf0  \
												   caption:\cf13 @"katia likes chris"\cf0  \
												  keywords:[NSArray arrayWithObject:\cf13 @"asynch"\cf0 ] \
												  latitude:\cf14 0\cf0  \
												 longitude:\cf14 0\cf0  \
												  altitude:\cf14 0\cf0 ];\
				
\f1\fs24 \CocoaLigature1 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 - (\cf3 void\cf0 )didCompleteUploadNotification:(NSNotification *)notification\
\{	\
	\cf12 // get the uploaded image's id\cf0 \
	SmugMugResponse *response = [smugmug responseFromDidCompleteUploadNotification:notification];\
	NSNumber *imageID = [[[_response responseDictionary] objectForKey:\cf13 @"Image"\cf0 ] objectForKey:\cf13 @"id"\cf0 ];\
\
	\cf12 // get an URL to the image\cf0 \
	response = [smugmug getInfoForImage:imageID];\
	NSString *largeURL = [[[response responseDictionary] objectForKey:\cf13 @"Image"\cf0 ] objectForKey:\cf13 @"LargeURL"\cf0 ];\
				\
	\cf12 // display in default browser\cf0 \
	[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:largeURL]];\
\}
\f1\fs24 \CocoaLigature1 \
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
\cf0 \
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf0 \CocoaLigature0 - (\cf3 void\cf0 )errorDuringUploadNotification:(NSNotification *)notification\
\{	\
	\cf12 // retrieve error dictionary from the distributed notification\cf0 \
	NSDictionary *errorDictionary = [smugmug errorDictionaryFromUploadErrorNotification:notification];\
	NSLog(\cf13 @"errorDictionary: %@"\cf0 , errorDictionary);\
\}\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f1\fs24 \cf0 \CocoaLigature1 \
\
\pard\tx480\tx960\tx1440\tx1920\tx2400\tx2880\tx3360\tx3840\tx4320\tx4800\tx5280\tx5760\tx6240\tx6720\tx7200\tx7680\tx8160\tx8640\tx9120\tx9600\tx10080\tx10560\tx11040\tx11520\tx12000\tx12480\tx12960\tx13440\tx13920\tx14400\tx14880\tx15360\tx15840\tx16320\tx16800\tx17280\tx17760\tx18240\tx18720\tx19200\tx19680\tx20160\tx20640\tx21120\tx21600\tx22080\tx22560\tx23040\tx23520\tx24000\tx24480\tx24960\tx25440\tx25920\tx26400\tx26880\tx27360\tx27840\tx28320\tx28800\tx29280\tx29760\tx30240\tx30720\tx31200\tx31680\tx32160\tx32640\tx33120\tx33600\tx34080\tx34560\tx35040\tx35520\tx36000\tx36480\tx36960\tx37440\tx37920\tx38400\tx38880\tx39360\tx39840\tx40320\tx40800\tx41280\tx41760\tx42240\tx42720\tx43200\tx43680\tx44160\tx44640\tx45120\tx45600\tx46080\tx46560\tx47040\tx47520\tx48000\ql\qnatural\pardirnatural

\f3\fs20 \cf3 \CocoaLigature0 @end\cf0 \
\
\
}